package com.fc.mall.portal.dto;

import com.fc.mall.exception.ServiceException;
import lombok.Getter;

/**
 * Created by Sunny on 2019/7/20.
 */
@Getter
public enum NoticeType {
    DELIVERYNOTICE(1, "发货通知"),
    WITHDRAWNOTICE(2, "提现到账通知"),
    APPROVALNOTICE(3, "审核通知");


    private Integer value;
    private String desc;
    NoticeType(Integer value, String desc)
    {
        this.value = value;
        this.desc = desc;
    }

    public static NoticeType fromInt(Integer value)
    {
        for (NoticeType type : NoticeType.values())
        {
            if(type.value.equals(value))
            {
                return type;
            }
        }
        throw new ServiceException("参数不正确");
    }
}
